<?php
namespace app\home\controller;
use app\home\model\Admin as adminModel;
use think\Controller;

class Index extends Controller
{
    protected $adminModel;
    public function __construct(AdminModel $adminModel)
    {
        parent::__construct();
        $this->adminModel = $adminModel;
    }

    public function index()
    {
        $user_id = session('user_id');
        $userInfo = $this->adminModel->find($user_id);
        $this->assign('userInfo', $userInfo);
        return $this->fetch();
    }

    public function hello($name = 'ThinkPHP5')
    {
        return 'hello,' . $name;
    }
}
